#ifndef CHASSIS_TASK_H
#define CHASSIS_TASK_H

#include "motor.h"
#include "System_Task.h"

typedef enum
{
	Chassis_Position,
	Chassis_Speed,
	Yaw_Position,
	Yaw_Speed,

	YAW_Position = 0,
	YAW_Speed,
	LF_P,
	LF_S,
	LB_P,
	LB_S,
	RF_P,
	RF_S,
	RB_P,
	RB_S,

} Chassis_Pid_Name;

typedef enum

{
	Disable, // 失能
	Sync,	 // 同步
	Lock,	 // 锁定

} Chassis_Mode_Name;

typedef struct
{

	float Midangle;
	float Angle_Gap;
	float Angle_UI;
	//	 float Buff_A;
	//	 float Buff_C;
	uint8_t Mode;
	uint8_t Last_Mode;
	int Loop;

	struct
	{
		float A;
		float B;
		float C;
	} Buff;
	struct
	{
		bool Trigger;
		bool Power;
		int High;
		int Low;
	} Flag;
	struct
	{
		struct
		{
			float Vx;
			float Vy;
		} Raw;
		struct
		{
			float Vx;
			float Vy;
			float Yaw;
		} Input;
		float Vx;
		float Vy;
		float Vw;
		float P[4];
		float V[4];
		int16_t Feedforward;
	} Move;
	struct
	{
		float Cos;
		float Sin;
		int Sync_Count;
	} Transform;
	int16_t Output[4];
	//    uint8_t      TX[8];

} Chassis_Info_Typedef;

extern Chassis_Info_Typedef Chassis_Info;

#endif
